/*
 * InertialSensor.cpp
 *
 *  Created on: Jun 5, 2016
 *      Author: Yang
 */

#include "InertialSensor.hpp"

void InertialSensor::update(void)
{
    MPU6000.Data_Refresh();
    L3GD20.Data_Refresh();
    LSM303D.Data_Refresh();

    _gyro[0] = MPU6000.gyro * DEG_TO_RAD;
    _accel[0] = MPU6000.accel;
    _gyro[1] = L3GD20.gyro * DEG_TO_RAD;
    _accel[1] = LSM303D.accel ;
}

void InertialSensor::init(void)
{
    MPU6000.Init();
    MPU6000.Data_calibration();
    L3GD20.Init();
    LSM303D.Init();
}

